<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script  type="text/javascript">
        var arr1 = new Array(1, 2, 3 , 4);
        var arr2 = ['A', 'B' ,'C'];
        console.log('用构造函数创建的arr1输出效果为；' + arr1);
        console.log('用字面量创建的arr2输出效果为：' + arr2);
        arr1.length = 2;
        console.log('改变lenght为2后，arr1输出效果为：' + arr1);
        arr2.length = 10;
        console.log('改变lenght为10后，arr2输出效果为：' + arr2);
    </script>
</body>
</html>